package net.ys.utils.req;

/**
 * User: NMY
 * Date: 19-6-4
 *
 * @author nmy
 */
public class HttpClient {
    public static HttpResponse doGet(String address) {
        String protocol = address.substring(0, 6).toLowerCase();
        if ("https:".equals(protocol)) {
            return HttpsUtil.doGet(address);
        }
        return HttpUtil.doGet(address);
    }

    public static HttpResponse doPostJson(String address, String json) {
        String protocol = address.substring(0, 6).toLowerCase();
        if ("https:".equals(protocol)) {
            return HttpsUtil.doPostJson(address, json);
        }
        return HttpUtil.doPostJson(address, json);
    }
}
